<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<!-- <meta HTTP-EQUIV="Refresh" CONTENT="1"/> -->
	<title>
		13ª EMR - Escola de Modelos de Regressão
	</title>
	<?php
		echo $this->Html->meta('icon');

		echo $this->Html->css(array('emr13','input', 'flash'));
		echo $this->Html->script(array('jquery-1.8.2', 'flash'));

		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
</head>
<body>
	<div id="fundo"></div>
	<div id="container">
		<?php echo $this->Session->flash(); ?>
		<div id="header">
			<div id="banner">
				<?php echo $this->Html->image('imagens/modelo2.jpg', array('url'=>"/")); ?>
			</div>
			<?php if(!$logado){?>
				<div id="login">
					<fieldset>
						<legend><?php echo __('Login'); ?></legend>
						<?php
							echo $this->Session->flash('auth');
							echo $this->Form->create(false, array('url' => '/users/login'));
							echo $this->Form->input('username');
							echo $this->Form->input('password');
							echo $this->Form->end('Login');
						?>
					</fieldset>
				</div>
				<div class="clear"></div>
			<?php }
				else {?>
				<div id="session"> Logado como 
					<?php echo $usuarioAtual['username'];
						  echo $this->Html->link('sair', '/Users/logout', array('class' => 'link_area'));
						  if($usuarioAtual['user_type'] == 0){
						  	echo $this->Html->link('minha área', '/Users/admin_area', array('class' => 'link_area'));
						  }
						  elseif($usuarioAtual['user_type'] == 1){
						  	echo $this->Html->link('minha área', '/Users/revisor_area', array('class' => 'link_area'));
						  }
						  elseif($usuarioAtual['user_type'] == 2){
						  	echo $this->Html->link('minha área', '/Users/user_area', array('class' => 'link_area'));
						  }
						  		
					?>
					
				</div>
			<?php }?>
            <div id="menu">
                
                <?php echo $this->Html->link('apresentação',array('controller'=>'Pages', 'action'=>'display', 'apresentacao')); ?>
                <?php echo $this->Html->link('inscrição',array('controller'=>'Pages', 'action'=>'display', 'inscricao')); ?>
				<?php echo $this->Html->link('submissões',array('controller'=>'Pages', 'action'=>'display', 'submissoes')); ?>
                <?php echo $this->Html->link('organização',array('controller'=>'Pages', 'action'=>'display', 'organizacao')); ?>
                <?php echo $this->Html->link('datas importantes',array('controller'=>'Pages', 'action'=>'display', 'datas_importantes')); ?>
                <?php echo $this->Html->link('atividades',array('controller'=>'Pages', 'action'=>'display', 'atividades')); ?>
				<?php echo $this->Html->link('acomodações',array('controller'=>'Pages', 'action'=>'display', 'acomodacoes')); ?>
            </div>
		</div>
		<div id="content">

			<?php echo $this->fetch('content'); ?>
			<div id="credito">
				
			    <div class="realizacao">
					<p> Realiza&ccedil;&atilde;o</p>
				    <?php echo $this->Html->image('imagens/logo-ime.png'); ?>
				</div>
				<div class="apoio">
					<p>Apoio</p>
					<?php echo $this->Html->image('imagens/logo_ABE.jpg'); ?>
				</div>
				<div class="patrocinio">
					<p>Patroc&iacute;nio</p>
					<?php echo $this->Html->image('imagens/logo_cnpq.gif'); ?>
					<?php echo $this->Html->image('imagens/capes-logo.jpg'); ?>
					<?php echo $this->Html->image('imagens/fapesp_logo.jpg'); ?>
					<?php echo $this->Html->image('imagens/faps_logo.jpg'); ?>
					<?php echo $this->Html->image('imagens/logo_sas.jpg'); ?>
				</div>
			</div>
		</div>
		<div id="footer">
			<?php echo $this->Html->image('imagens/base.jpg'); ?>
			<?php echo $this->Html->link(
					$this->Html->image('cake.power.gif', array('alt' => __('CakePHP: the rapid development php framework'), 'border' => '0')),
					'http://www.cakephp.org/',
					array('target' => '_blank', 'escape' => false)
				);
			?>
		</div>
	</div>
	<?php //echo $this->element('sql_dump'); ?> 
</body>
</html>
